var express = require('express');
var router = express.Router();
var connection=require('../db/sql.js')

/* GET home page. */
router.get('/index', function(req, res, next) {
	// console.log(req)
     //查询数据
    connection.query('select * from  tableData',function(error,results,fields){
		// if(error) throw error;
		console.log(results);
		res.json(results) //返回数据类型
	})
});
router.get('/my', function(req, res, next) {
 res.json({
	 "a":'1'
 })
});

module.exports = router;
